package com.i2bt.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 
 * Title : 文件详细信息类
 *
 * Description : 包含了文件名, 文件大小, 是否是文件
 *
 * CreatedTime : 2014-8-12
 *
 * @author wuliao & kakaxi & yi
 *
 * @version 1.0
 *
 */

public class FileInfoBean implements Parcelable{
	
	private String fileName;		//文件名
	
	private long fileLength;		//文件大小
	
	private boolean isFile;		//是否是文件
	
	public FileInfoBean() {}
	
	public FileInfoBean(String fileName, long fileLength, boolean isFile) {
		super();
		this.fileName = fileName;
		this.fileLength = fileLength;
		this.isFile = isFile;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public long getFileLength() {
		return fileLength;
	}

	public void setFileLength(long fileLength) {
		this.fileLength = fileLength;
	}

	public boolean isFile() {
		return isFile;
	}

	public void setFile(boolean isFile) {
		this.isFile = isFile;
	}
	
	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(fileName);
		dest.writeLong(fileLength);
		dest.writeBooleanArray(new boolean[] {isFile});
	}

	public static final Parcelable.Creator<FileInfoBean> CREATOR
	= new Parcelable.Creator<FileInfoBean>() {
		
		public FileInfoBean createFromParcel(Parcel in) {
			return new FileInfoBean(in);
		}

		public FileInfoBean[] newArray(int size) {
			return new FileInfoBean[size];
		}
	};
	
	public FileInfoBean(Parcel in) {
		fileName = in.readString();
		fileLength = in.readLong();
		boolean[] booleanArr = new boolean[1];
		in.readBooleanArray(booleanArr);
		isFile = booleanArr[0];
	}

}
